<?php
class Controller
{
	public $tpl = null;
	
	public function __construct()
	{
		$this->tpl = Util::getTpl('Index');
	}
	
	private function _clearUserCookies()
	{
		Util::clearCookies('email');
		Util::clearCookies('enpass');
		return;
	}
	 
	public function Show()
	{
		$this->NotFound();
	}
	
	/* 
	 * 等同于tpl->assign
	 */
	public function assign($var, $val)
	{
		$this->tpl->assign($var, $val);
	}
	
	/*
	 * 等同于$tpl->display 
	 */
	public function display($tpl_name)
	{
		$this->tpl->display($tpl_name);
		exit();
	}
	/*
	 * 等同于$tpl->fetch 
	 */
	public function fetch($tpl_name)
	{
		return $this->tpl->fetch($tpl_name);
	}
	
	/*
	 * 缺省页面
	 */
	public function NotFound()
	{
		Util::ajaxReturn('203', '悲摧了，请求页面不存在');
		$this->display('Controller/NotFound.html');
	}
	
	public function __call($name, $arguments)
	{
		$this->NotFound();
	}
	
	public function __get($name)
	{
		$this->NotFound();
	}
}